package Presentation;

import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.util.Date;

import Modele.Historique;
import Modele.IHistorique;

import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;


public class Presentation extends Application
{

    
    
    public static void main(String[] args){
        Application.launch(args);
    }
    
    //Lancement de la fenêtre principale
    @Override
    public void start(Stage stage1) throws Exception {
        
        stage1.setTitle("Navigateur Groupe 4");
        final String authUser = "etudiant";
        final String authPassword = "etudiant";
        Authenticator.setDefault(
                new Authenticator() {
                    @Override
                    public PasswordAuthentication getPasswordAuthentication() {
                        return new PasswordAuthentication(
                                authUser, authPassword.toCharArray());
                    }
                }
                );
        
        System.setProperty("http.proxyHost", "172.16.13.3");
        System.setProperty("http.proxyPort", "8080");
        
        final FenetrePrincipale FenetreP = new FenetrePrincipale(this);

        stage1.setScene((Scene) FenetreP);
        stage1.show();
        
        stage1.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                FenetreP.Fermeture();
            }
        });
    }
    
}
